//
//  NewFeatureCell.swift
//  swift_demo_weibo
//
//  Created by 杨兵 on 15/5/14.
//  Copyright (c) 2015年 bing. All rights reserved.
//

import UIKit

class NewFeatureCell: UICollectionViewCell {
    
    @IBOutlet weak var iconView: UIImageView!
    
    @IBOutlet weak var startbtn: UIButton!
    
    var selectIndex:Int = 0 {
        didSet {
            iconView.image = UIImage(named: "new_feature_\(selectIndex)")
            startbtn.hidden = true
        }
        
    }
    
    func showBtn(){
        startbtn.hidden = false
        startbtn.userInteractionEnabled = false
        startbtn.transform = CGAffineTransformMakeScale(0.0, 0.0)
        
        UIView.animateWithDuration(0.5, animations: { () -> Void in
            self.startbtn.transform = CGAffineTransformMakeScale(1.0, 1.0)
        }) { (Bool) -> Void in
            self.startbtn.userInteractionEnabled = true
        }
        
    }
    
    // 切换到主页面
    @IBAction func toHomepage() {
        NSNotificationCenter.defaultCenter().postNotificationName(viewControllerNotifi, object: "Main")
        
    }
    
}
